// 220118 2000

// OS 模块

var os = require('os');

console.log('os 方法：')
console.log("tmpdir=" + os.tmpdir());
console.log("endianness=" + os.endianness());
console.log("hostname=" + os.hostname());
console.log("type=" + os.type());
console.log("platform=" + os.platform());
console.log("arch=" + os.arch());
console.log("release=" + os.release());
console.log("uptime=" + os.uptime());
console.log("loadavg=" + os.loadavg());
console.log("totalmem=" + os.totalmem());
console.log("freemem=" + os.freemem());

var cpus = os.cpus();
console.log("cpus=\n");
console.log(cpus);
console.log("cpu forEach:");
cpus.forEach(cpu => {
	console.log(cpu);
});
var netis = os.networkInterfaces();
console.log("networkInterfaces=\n");
console.log(netis);

// OK
console.log("netis.WLAN=\n");
console.log(netis.WLAN);
// failed
// console.log(netis.'Loopback Pseudo-Interface 1');

console.log("netis for loop:")
for (var key in netis) {
	console.log(key);
	console.log(netis[key]);
}

console.log('os 属性：')
console.log("EOL=" + os.EOL);
